package com.it.tydic.estate.module.controller.khgl;

import com.it.tydic.estate.common.annotation.ControllerDesc;
import com.it.tydic.estate.common.aop.Result;
import com.it.tydic.estate.common.constants.LogConstants;
import com.it.tydic.estate.module.model.Dto.TbMoveInDto;
import com.it.tydic.estate.module.model.inner.TbCustomerProfile;
import com.it.tydic.estate.module.model.inner.TbMoveIn;
import com.it.tydic.estate.module.service.MoveInService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @description:    客户迁入房间管理接口
 * @author: liuhui
 * @createDate: 2020/3/2
 * @version: 1.0
 */
@RestController
@RequestMapping("moveIn")
@Api(tags = "迁入房间管理")
public class MoveInController {
    @Autowired
    private MoveInService moveInService;   /*迁入*/

    /**
     * 查询获取所有可以入住的房间
     */
    @PostMapping("/getListMove")
    @ApiOperation(value = "查询获取所有可以入住的房间", notes = "查询获取所有可以入住的房间")
    public Result getListMove(@RequestBody Map<String,Object> tbMoveIn){
        return moveInService.getList(tbMoveIn);
    }
    /**
     * 入住信息详情
     * @return
     */
    @GetMapping("/getById/{id}")
    @ApiOperation(value = "入住信息详情", notes = "入住信息详情")
    public Result getById(@RequestParam String id){
        return moveInService.getById(id);
    }
    /**
     * 添加入住信息
     */

    @PostMapping("/addMoveIn")
    @ControllerDesc(description = LogConstants.addOrUpdate_data)
    @ApiOperation(value = "添加入住信息", notes = "添加入住信息")
    public Result addMoveIn(@RequestBody TbMoveInDto moveIn){
        return moveInService.addMoveIn(moveIn);
    }

}
